<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <title>Layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

    <link rel="stylesheet" th:href="@{/layui/css/layui.css}"  media="all">
    <script th:src="@{/layui/layui.js}" charset="utf-8"></script>
</head>
<body>



<form class="layui-form" action="" id="form1">
<br>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">名字</label>
            <div class="layui-input-inline">
                <input type="text" name="name"  autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">微信备注</label>
            <div class="layui-input-inline">
                <input type="text" name="wecharno"  autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">微信ID</label>
            <div class="layui-input-inline">
                <input type="tel" name="wecharname" autocomplete="off" class="layui-input">
            </div>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">QQ号</label>
            <div class="layui-input-inline">
                <input type="tel" name="qqno" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">购买课程</label>
            <div class="layui-input-inline">
                <select name="coursename"  lay-search="">
                    <option value="">直接选择或搜索选择</option>
                    <option value="springBoot实战">springBoot实战</option>
                    <option value="springCloud">springCloud</option>
                    <option value="vue">vue</option>
                    <option value="layui">layui</option>
                </select>
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">价格</label>
            <div class="layui-input-inline">
                <input type="text" name="courseprice"  autocomplete="off" class="layui-input">
            </div>
        </div>


    </div>

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">订单日期</label>
            <div class="layui-input-inline">
                <input type="text" name="orderdate" id="orderdate"  placeholder="yyyy-MM-dd" autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-inline">
            <label class="layui-form-label">评论</label>
            <div class="layui-input-inline">
                <input type="text" name="remark"  autocomplete="off" class="layui-input">
            </div>
        </div>

    </div>


</form>
<div class="layui-form-item">
    <div class="layui-input-block">
        <button type="submit" onclick="doSave()" class="layui-btn" lay-submit="" lay-filter="demo1">立即提交</button>
        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
    </div>
</div>

<!-- 注意：如果你直接复制所有代码到本地，上述 JS 路径需要改成你本地的 -->
<script>

    var $,layer;
    layui.use(['form','laydate'],function (){

       var laydate = layui.laydate;
       $=layui.jquery;
       layer=layui.layer;

        //日期
        laydate.render({
            elem: '#orderdate'
        });
    })

    function doSave() {
       var requestData = $("#form1").serialize();

        $.post("/courseorder/save",requestData,function (responseData) {
            if(responseData.success == 1){
               parent.layer.alert("添加成功",{yes:function () {
                       parent.layer.closeAll();
                       window.parent.location.reload();
                   }});
            }
            
        });
    }

</script>

</body>
</html>